package Dialog;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.example.zelonghu.testgps.R;

/**
 * @author zelonghu QQ:1032006226
 * @name testGPS2
 * @class name：Dialog
 * @class describe
 * @time 2019/7/2 7:51 PM
 * @change
 * @chang time
 * @class describe
 */
public class Clothes_Donation_Detial_Dialog extends Dialog {
    public Clothes_Donation_Detial_Dialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    public static class Builder{
        TextView ctype;
        TextView cdescribe;

        Clothes_Donation_Detial_Dialog mDialog;
        View mlayout;
        public Builder(Context context) {
            mDialog = new Clothes_Donation_Detial_Dialog(context, R.style.Theme_AppCompat_Dialog);
            LayoutInflater inflater =
                    (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            mlayout = inflater.inflate(R.layout.clothes_donation_detial_dialog_layout, null, false);
           ctype = (TextView)mlayout.findViewById(R.id.clothes_donation_name_tw);
           cdescribe = (TextView)mlayout.findViewById(R.id.clotthes_donation_describe_tw);

        }
        public Builder settype(String type){
            ctype.setText(type);
            return this;
        }
        public Builder setdescribe(String type){
            cdescribe.setText(type);
            return this;
        }

        public Clothes_Donation_Detial_Dialog create() {
            mDialog.setContentView(mlayout);
            mDialog.setCancelable(true);                //用户可以点击后退键关闭 Dialog
            mDialog.setCanceledOnTouchOutside(true);   //用户不可以点击外部来关闭 Dialog
            return mDialog;
        }
    }
}
